<?php

/**
 * LogPlanilla form base class.
 *
 * @method LogPlanilla getObject() Returns the current form's model object
 *
 * @package    ehockey
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseLogPlanillaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'planilla_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Planilla'), 'add_empty' => false)),
      'usuario_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Usuario'), 'add_empty' => false)),
      'operacion'   => new sfWidgetFormChoice(array('choices' => array('carga completa' => 'carga completa', 'carga parcial' => 'carga parcial', 'imprimir' => 'imprimir', 'observar' => 'observar', 'aceptar' => 'aceptar', 'ver planilla completa' => 'ver planilla completa', 'cierre planilla observada' => 'cierre planilla observada'))),
      'descripcion' => new sfWidgetFormInputText(),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'planilla_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Planilla'))),
      'usuario_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Usuario'))),
      'operacion'   => new sfValidatorChoice(array('choices' => array(0 => 'carga completa', 1 => 'carga parcial', 2 => 'imprimir', 3 => 'observar', 4 => 'aceptar', 5 => 'ver planilla completa', 6 => 'cierre planilla observada'))),
      'descripcion' => new sfValidatorString(array('max_length' => 255)),
      'created_at'  => new sfValidatorDateTime(),
      'updated_at'  => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('log_planilla[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LogPlanilla';
  }

}
